package org.example.myerp.controller;

import java.util.List;

import org.example.myerp.mapper.productDesign.customSetup.ProclassThreeMapper;
import org.example.myerp.pojo.PageMyself;
import org.example.myerp.pojo.*;import org.example.myerp.service.ProclassThreeService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * ��������˵����Ʋ�
 * @author DELL
 *
 *///
//@CrossOrigin(methods = { RequestMethod.POST, RequestMethod.GET }, allowCredentials = "true", allowedHeaders = "*")
@RestController
//
@RequestMapping("/design/proclassThree")
public class ProclassThreeController {
	@Autowired
    ProclassThreeService proclassThreeService;

	/**
	 * ��ѯȫ��һ��������Ϣ
	 * @return
	 */
	@RequestMapping("/getFindOneCslassifyAll")
	public @ResponseBody List<ProclassThree> getFindOneCslassifyAll(){
		List<ProclassThree> list = proclassThreeService.getFindThreeCslassifyAll();
		return list;
	}

	/**
	 * ���ݶ�����Ų�ѯ����������Ϣ
	 * @param iiId
	 * @return
	 */
	@RequestMapping("/getByProcalssTwoByIiIdfindProclassThree")
	@ResponseBody
	public List<ProclassThree> getByProcalssTwoByIiIdfindProclassThree(Integer iiId){
		List<ProclassThree> list = proclassThreeService.getByProcalssTwoByIiIdfindProclassThree(iiId);
		return list;
	}

	/**
	 * �����������в�ѯȫ������������Ϣ����ҳ��ѯ��
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	@RequestMapping("/getProclassThrees")
	@ResponseBody
	public PageMyself<ProclassThreeMapper> getProclassThrees(Integer pageNum, Integer pageSize, String proName) {
		PageMyself<ProclassThreeMapper> getProclassOnes = proclassThreeService.findThreeCslassifyByPagerMessage((pageNum-1)*pageSize, pageSize, proName);
		return getProclassOnes;
	}

	@RequestMapping("/threeadd")
	public @ResponseBody Integer getInsertProclassThreeByProName(@RequestBody ProclassThree proclassThree) {
		System.out.println(proclassThree);
		Integer row = proclassThreeService.getInsertThreeCslassifyByProName(proclassThree);
		return row;
	}

	@RequestMapping("/getdeleteInBatchesProclassThreeByIIIds")
	public @ResponseBody Integer getdeleteInBatchesProclassThreeByIIIds(Integer[] iiiIds) {
		Integer row = proclassThreeService.getdeleteInBatchesThreeCslassifyByIIIds(iiiIds);
		return row;
	}
}
